package com.hwh.controller;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.hwh.service.BuyersService;
import com.hwh.serviceIm.BuyersServiceImpl;
import com.hwh.vo.Buyers;

public class SelAllBuyerController extends HttpServlet{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		super.doPost(req, resp);
	}

	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

		ArrayList<Buyers> buyers = new ArrayList<Buyers>();
		BuyersService os = new BuyersServiceImpl();

		buyers = os.getBuyers();

		// 将stores对象放入session中,前台用EL表达式获取值
		HttpSession session = req.getSession();

		session.setAttribute("buyers", buyers);

		req.getRequestDispatcher("abuyers.jsp").forward(req, resp);

	}
	
}
